(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 11.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     11648,        274]
NotebookOptionsPosition[     11001,        249]
NotebookOutlinePosition[     11435,        268]
CellTagsIndexPosition[     11392,        265]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 StyleBox["\:6c42\:89e3\:6cd5\:7ebf", "Title"]], "Input",
 CellFrame->{{0, 0}, {0.5, 0}},
 CellGroupingRules->{"GroupTogetherGrouping", 10000.},
 CellChangeTimes->{{3.817331932618697*^9, 3.8173319460104628`*^9}, 
   3.817348546926899*^9, {3.817357762925655*^9, 3.8173577657199345`*^9}, 
   3.817521823174597*^9, {3.818309864688902*^9, 3.8183098702494583`*^9}},
 TextAlignment->Center],

Cell[CellGroupData[{

Cell[BoxData[
 StyleBox[
  RowBox[{
  "\:62d6\:52a8\:5c04\:7ebf", "\:ff0c", 
   "\:53ef\:4ee5\:89c2\:5bdf\:5230\:6cd5\:7ebf\:7684\:53d8\:5316"}], 
  "Subsubsection"]], "Input",
 CellGroupingRules->{"GroupTogetherGrouping", 10002.},
 CellChangeTimes->{{3.8173379409549494`*^9, 3.8173379763469496`*^9}, 
   3.817348546926899*^9, 3.8174156245745373`*^9, {3.817415663231971*^9, 
   3.817415673960292*^9}, {3.8183098805764904`*^9, 3.8183099010225353`*^9}},
 TextAlignment->Center],

Cell[BoxData[{
 RowBox[{
  RowBox[{"unitCircle", "=", 
   RowBox[{"Circle", "[", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"rayStart", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "2"}], ",", "2"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Manipulate", "[", "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"rayEnd", ":=", "p"}], ";", "\[IndentingNewLine]", 
    RowBox[{"solution", "=", 
     RowBox[{"NSolve", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"{", 
         RowBox[{"x", ",", "y"}], "}"}], "\[Element]", "unitCircle"}], "&&", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"x", ",", "y"}], "}"}], "\[Element]", 
        RowBox[{"HalfLine", "[", 
         RowBox[{"{", 
          RowBox[{"rayStart", ",", "rayEnd"}], "}"}], "]"}]}], "&&", 
       RowBox[{"x", "<", "y"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
    RowBox[{"Graphics", "[", 
     RowBox[{
      RowBox[{"{", "\[IndentingNewLine]", 
       RowBox[{"unitCircle", ",", 
        RowBox[{"Arrow", "[", 
         RowBox[{"{", 
          RowBox[{"rayStart", ",", "p"}], "}"}], "]"}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"solution", "\[NotEqual]", 
           RowBox[{"{", "}"}]}], ",", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Style", "[", 
             RowBox[{
              RowBox[{"{", 
               RowBox[{
                RowBox[{"Text", "[", 
                 RowBox[{"\"\<\:6700\:8fd1\:89e3\>\"", ",", 
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"x", "/.", 
                    RowBox[{"solution", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "+", "0.3"}], 
                    ",", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"y", "/.", 
                    RowBox[{"solution", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "+", "0.2"}]}], 
                   "}"}]}], "]"}], ",", 
                RowBox[{"Point", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"x", "/.", 
                    RowBox[{"solution", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                   RowBox[{"y", "/.", 
                    RowBox[{"solution", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}]}], "}"}], "]"}]}], "}"}],
               ",", "Red"}], "]"}], ",", "\[IndentingNewLine]", 
            "\[IndentingNewLine]", 
            RowBox[{"Arrow", "[", 
             RowBox[{"{", 
              RowBox[{
               RowBox[{"{", 
                RowBox[{"0", ",", "0"}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{
                 RowBox[{"x", "/.", 
                  RowBox[{"solution", "[", 
                   RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                 RowBox[{"y", "/.", 
                  RowBox[{"solution", "[", 
                   RowBox[{"[", "1", "]"}], "]"}]}]}], "}"}]}], "}"}], 
             "]"}]}], "}"}], ",", 
          RowBox[{"Text", "[", "\"\<\:65e0\:89e3\>\"", "]"}]}], "]"}]}], 
       "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
      RowBox[{"Axes", "\[Rule]", "True"}], ",", 
      RowBox[{"PlotRange", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{
           RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "}"}]}]}], 
     "\[IndentingNewLine]", "]"}]}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"p", ",", 
       RowBox[{"{", 
        RowBox[{"0", ",", "0"}], "}"}]}], "}"}], ",", "Locator"}], "}"}]}], 
  "]"}]}], "Input",
 CellGroupingRules->{"GroupTogetherGrouping", 10002.},
 CellChangeTimes->{{3.817333895641637*^9, 3.8173339709333687`*^9}, {
   3.81733401392829*^9, 3.8173340177603006`*^9}, {3.817334557001119*^9, 
   3.817334586799177*^9}, {3.8173346247757807`*^9, 3.8173346540459967`*^9}, 
   3.817334857444251*^9, {3.817334892441251*^9, 3.8173349357212505`*^9}, {
   3.8173349706662507`*^9, 3.817335027612251*^9}, {3.8173350973042507`*^9, 
   3.817335128815251*^9}, {3.817335237379274*^9, 3.8173352935398893`*^9}, {
   3.8173353316346984`*^9, 3.8173353889424286`*^9}, {3.8173354748080144`*^9, 
   3.81733555447298*^9}, 3.817335591787711*^9, {3.817335626826215*^9, 
   3.8173356328068123`*^9}, {3.817335695044036*^9, 3.8173357361971507`*^9}, {
   3.8173357673772683`*^9, 3.817335801774708*^9}, {3.817335887846314*^9, 
   3.8173359354990788`*^9}, {3.8173359818987184`*^9, 
   3.8173360571442423`*^9}, {3.8173361918207083`*^9, 3.817336238160342*^9}, 
   3.817336489739497*^9, 3.8173379763469496`*^9, {3.8173477193833776`*^9, 
   3.817347732861725*^9}, {3.8173477883302717`*^9, 3.8173478044988885`*^9}, 
   3.817348546927899*^9, {3.8173490648879194`*^9, 3.817349121790609*^9}, {
   3.817349174255855*^9, 3.8173492572001486`*^9}, {3.817349330670495*^9, 
   3.817349335480976*^9}, {3.8173495632617517`*^9, 3.817349602256651*^9}, {
   3.8173497379652205`*^9, 3.8173497419396176`*^9}, 3.81735012210063*^9, {
   3.8173501700124207`*^9, 3.8173501825916786`*^9}, {3.8173502510995283`*^9, 
   3.817350260349454*^9}, {3.8173506229087057`*^9, 3.8173506516575804`*^9}, {
   3.8173508048919024`*^9, 3.8173508274891615`*^9}, {3.8173541353049245`*^9, 
   3.8173541904474382`*^9}, {3.8173542294453373`*^9, 3.817354281702563*^9}, {
   3.817354479236314*^9, 3.8173545032827187`*^9}, {3.8173545508454742`*^9, 
   3.8173546698063693`*^9}, {3.8173586305744114`*^9, 3.817358633190673*^9}, {
   3.817358764258778*^9, 3.817358828873239*^9}, 3.8174156245745373`*^9, {
   3.817415663231971*^9, 3.817415673961315*^9}, {3.8174179924214516`*^9, 
   3.8174179957276134`*^9}, 3.81741980884787*^9, {3.8174198443405056`*^9, 
   3.8174198498571787`*^9}, {3.817510793124935*^9, 3.8175107956651893`*^9}, {
   3.817510856418264*^9, 3.817510913024372*^9}, 3.8175109827803965`*^9, {
   3.8175111544412284`*^9, 3.817511196139058*^9}, {3.81751134795365*^9, 
   3.81751145206365*^9}, {3.81751149240565*^9, 3.817511569931622*^9}, {
   3.817511627843413*^9, 3.8175116704146695`*^9}, {3.8175246484103627`*^9, 
   3.8175246499425163`*^9}, {3.8175247857690973`*^9, 
   3.8175248080953293`*^9}, {3.817526853203825*^9, 3.8175268558920937`*^9}, 
   3.8175335319660587`*^9, {3.817598243487692*^9, 3.817598247741692*^9}, {
   3.817598312353692*^9, 3.817598313978692*^9}, 3.8183098370291367`*^9, {
   3.8206182067870398`*^9, 3.82061820879024*^9}}]
}, Open  ]],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`p$$ = {
    0.28400000000000025`, -0.18999999999999995`}, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"\:65e0\:6807\:9898\"", Typeset`specs$$ = {{{
       Hold[$CellContext`p$$], {0, 0}}, Automatic}}, Typeset`size$$ = {
    432., {215., 221.}}, Typeset`update$$ = 0, Typeset`initDone$$, 
    Typeset`skipInitDone$$ = True}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`p$$ = {0, 0}}, 
      "ControllerVariables" :> {}, 
      "OtherVariables" :> {
       Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
        Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
        Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
         Typeset`skipInitDone$$}, 
      "Body" :> ($CellContext`rayEnd := $CellContext`p$$; \
$CellContext`solution = NSolve[
          And[
           Element[{$CellContext`x, $CellContext`y}, $CellContext`unitCircle], 
           Element[{$CellContext`x, $CellContext`y}, 
            
            HalfLine[{$CellContext`rayStart, $CellContext`rayEnd}]], \
$CellContext`x < $CellContext`y]]; Graphics[{$CellContext`unitCircle, 
          Arrow[{$CellContext`rayStart, $CellContext`p$$}], 
          If[$CellContext`solution != {}, {
            Style[{
              Text["\:6700\:8fd1\:89e3", {ReplaceAll[$CellContext`x, 
                  Part[$CellContext`solution, 1]] + 0.3, 
                ReplaceAll[$CellContext`y, 
                  Part[$CellContext`solution, 1]] + 0.2}], 
              Point[{
                ReplaceAll[$CellContext`x, 
                 Part[$CellContext`solution, 1]], 
                ReplaceAll[$CellContext`y, 
                 Part[$CellContext`solution, 1]]}]}, Red], 
            Arrow[{{0, 0}, {
               ReplaceAll[$CellContext`x, 
                Part[$CellContext`solution, 1]], 
               ReplaceAll[$CellContext`y, 
                Part[$CellContext`solution, 1]]}}]}, 
           Text["\:65e0\:89e3"]]}, Axes -> True, 
         PlotRange -> {{-2, 2}, {-2, 2}}]), 
      "Specifications" :> {{{$CellContext`p$$, {0, 0}}, Automatic, 
         ControlType -> Locator}}, "Options" :> {}, "DefaultOptions" :> {}],
     ImageSizeCache->{497., {255., 262.}},
     SingleEvaluation->True],
    Deinitialization:>None,
    DynamicModuleValues:>{},
    SynchronousInitialization->True,
    UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
    UnsavedVariables:>{Typeset`initDone$$},
    UntrackedVariables:>{Typeset`size$$}], "Manipulate",
   Deployed->True,
   StripOnInput->False],
  Manipulate`InterpretManipulate[1]]], "Output",
 CellChangeTimes->{3.8183098382232556`*^9, 3.8206184594062986`*^9}]
},
WindowToolbars->"EditBar",
WindowSize->{784, 810},
WindowMargins->{{Automatic, 0}, {Automatic, 0}},
CellContext->Notebook,
Magnification:>1.2 Inherited,
FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (2016\:5e7410\:67088\
\:65e5)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 398, 7, 90, "Input",
 CellGroupingRules->{"GroupTogetherGrouping", 10000.}],
Cell[CellGroupData[{
Cell[981, 31, 475, 10, 45, "Input",
 CellGroupingRules->{"GroupTogetherGrouping", 10002.}],
Cell[1459, 43, 6658, 142, 793, "Input",
 CellGroupingRules->{"GroupTogetherGrouping", 10002.}]
}, Open  ]],
Cell[8132, 188, 2865, 59, 537, "Output"]
}
]
*)

